import cn.hutool.core.io.file.FileReader;
import com.google.common.base.Strings;
import util.Const;
import util.CreateUtil;

import java.util.ArrayList;
import java.util.List;

public class CreateZoo {

    static final String FILA_NAME = "zoo.txt";

    public static void main(String[] args) {

        List<String> zooList = new ArrayList<>();
        List<String> zooPkList = new ArrayList<>();
        FileReader fileReader = new FileReader(FILA_NAME);
        List<String> lines = fileReader.readLines();

        for (String line : lines) {
            if (Strings.isNullOrEmpty(line)) {
                continue;
            }
            if (line.contains("当前账号所在队伍PK互助码")) {
                zooPkList.add(line.substring(line.indexOf("：") + 1));
            } else if (line.contains("当前账号个人互助码")) {
                zooList.add(line.substring(line.indexOf("：") + 1));
            }
        }
        CreateUtil.createJdMy(Const.zoo, zooList.toArray(new String[0]), zooList.size());
        CreateUtil.createJdMy(Const.zooPk, zooPkList.toArray(new String[0]), zooPkList.size());
    }

}
